package com.skynet.supervision.aop.validate;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Target({FIELD, METHOD, PARAMETER, ANNOTATION_TYPE, TYPE_USE})
@Retention(RUNTIME)
@Constraint(validatedBy = GoodStringValidator.class)
public @interface GoodString {
    String[] value() default {};

    boolean required() default true;

    /**
     * 字符串:不允许带有空格
     */
    boolean noSpace() default true;

    /**
     * 不可以为空字符串
     */
    boolean noEmpty() default true;

    String message() default "不是一个有效的参数";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
